home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 113
/
113.d81
/
lsps source.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
26KB
|
895 lines
10 open 1,8,1,"0:object,p"
20 open 4,4
30 sys700
40 *=$0801 ;basic load address!
50 .opt n,p4,o1
60 ;**********************************
70 ;*
80 ;* copyright 1986,87,88,89,90,91,92
90 ;* by gre(NULL)ry robert schiedler
100 ;* 12906 downs road ne
110 ;* mount angel, or 97362
120 ;* (503)845-2802 (503)845-6821
130 ;* all rights reverved...
140 ;*
150 ;*********************************
160 ; definitions/equates for
170 ; external label references
180 ;
190 fretop = $33
200 msgflg = $9d
210 mask01 = $9e
220 mask02 = $9f
230 tape1 = $b2
240 lstx = $c5
250 ;
260 ;free zero page user locations
270 ;
280 usr01 = $fb
290 usr02 = $fc
300 usr03 = $fd
310 usr04 = $fe
320 ;
330 ;disk name & id byte locations
340 ;
350 diskname =$0807
360 id01 = $0819
370 id02 = $081a
380 ;
390 buff1c00 = $1c00 ;name string under graphics
400 namebuff = $1f00 ;current name for load
410 moveit = $a3bf ;basic subroutine to move code
420 ;
430 ;screen color pokes
440 ;
450 border = $d020
460 bkgrnd = $d021
470 ;
480 ;kernal subroutine calls
490 ;
500 setmsg = $ff90 ;control kernal messages
510 setlfs = $ffba ;set locical 1st & 2nd address
520 setnam = $ffbd ;set file name
530 open = $ffc0 ;open a logical file
540 chkout = $ffc9 ;open a channel for output
550 chrout = $ffd2 ;output a character a-reg
560 load = $ffd5 ;load ram from device
570 clall = $ffe7 ;close all files and channels
580 ;
590 ;---------------------------------
600 onlyml _ 1 ;set to 1 or 0
610 ;---------------------------------
620 ; set to 1 to assemble only the
630 ; code @ $8000 pure m/l
640 ; set to 0 to assemble the basic
650 ; loader & the m/l @ $8000
660 ; note!!! you must then load the
670 ; object with a monitor and remove
680 ; all the junk bytes the assembler
690 ; padded into the object file...
700 ;---------------------------------
710 ;
720 *=$0801 ;original p/c
730 ;
740 .if onlyml:.goto1040
750 ;
760 .bas
770 sys"enter"rem graphic printer v2.01
780 end
790 ;
800 ;--------------------------------
810 ;
820 enter lda #>ml ;high byte load addr
830 sta $60
840 lda #<ml ;low byte load addr
850 sta $5f
860 lda #>last-$8000+ml ;high limit
870 sta $5b
880 lda #<last-$8000+ml ;high limit
890 sta $5a
900 lda #<last ;target address hi limit
910 sta $58
920 lda #>last ;target address hi limit
930 sta $59
940 jsr moveit ;(NULL) the code up!!!
950 jmp cold ;enter the (NULL)ed up code
960 ;
970 ml = *;
980 ;
990 ; note the assembler will pad the
1000 ; object file with junk from here
1010 ; to the m/l @ $8000!!!
1020 ;
1030 ;
1040 *= $8000 ; new code @ $8000
1050 ;
1060 ;
1070 cold lda #$40
1080 jsr setmsg ;turn on contorl messages
1090 lda #$80
1100 sta msgflg ;flag $80 = direct mode
1110 lda #$00
1120 sta border
1130 sta bkgrnd ;screen & border to black
1140 lda #$93
1150 jsr chrout ;clear the screen
1160 jsr prmsg01 ;<position paper mess>
1170 lda #$64
1180 sta lstx ;set last key to $64=no key
1190 wait lda lstx
1200 cmp #$01
1210 bne wait ;wait until user presses a key
1220 lda #$00
1230 jsr setnam ;no name
1240 lda #$04
1250 ldx #$04
1260 ldy #25 ;printer interface initilization 4,4,25
1270 jsr setlfs
1280 jsr open ;open lfn #4
1290 ldx #$04
1300 jsr chkout ;set lfn #4 to output
1310 lda #$00
1320 jsr chrout ;output a null <lock interface>
1330 jsr clall ;close all files
1340 jsr fill1 ;fill graphic file area $2000-$4800
1350 lda #10
1360 sta lpcnt01 ;set loop counter to 10
1370 lda #$93
1380 jsr chrout ;clear the screen
1390 jsr dirload ;load directory @ $0801 on up
1400 lda #$08
1410 sta xchglo
1420 sta xchghi ;indirection ($0808)
1430 lda #11
1440 sta rowcnt ;11 rows per page
1450 jsr nameid ;process disk directory name and id
1460 jsr prnameid ;printout the disk name and id
1470 br02 jsr fill3 ;fill 1c00-1cff <file name buffer>
1480 lda #$00
1490 sta fretop
1500 lda #$1c
1510 sta fretop+1 ;strings to --$1c00=<protect buff>
1520 pha
1530 lda #$93
1540 jsr chrout ;clear the screen
1550 pla
1560 jsr loadem ;load 10 graphics <$2000-$4800>
1570 sta lpcnt01 ;# of graphics loaded a-reg
1580 cmp #$00 ;exit if no graphics were loaded
1590 beq br04 ;branch and exit
1600 lda #$20
1610 sta indhi01
1620 lda #$00
1630 sta indlo01 ;set to $2000 start of files in ram
1640 sta flag01 ;flag 0=normal $ff=<and $f0>/print
1650 jsr process ;
1660 jsr process ;
1670 jsr process ;process graphic into printer buffer
1680 jsr process ;6 normal passes
1690 jsr process ;
1700 jsr process ;
1710 lda #$ff ;set flag for and with $f0
1720 sta flag01 ;set the flag
1730 jsr process ;process 7th row <and -w- $f0>
1740 jsr prnames ;print graphic names under graphics
1750 dec rowcnt ;counter for next page title
1760 bne br03 ;if not zero contine with curr page
1770 jsr formfeed ;leave some space between rows
1780 jsr prnameid ;label next page of graphics
1790 lda #11 ;11 rows/page
1800 sta rowcnt ;reset counter
1810 br03 lda lpcnt01
1820 cmp #10 ;check the loop counter
1830 beq br02
1840 br04 jsr formfeed ;formfeed and exit!!!
1850 jsr clall ;close all files
1860 jmp cold ;(NULL) it again sam!!! was (rts)
1870 ;
1880 ;---------------------------------
1890 ;
1900 process = * ;
1910 jsr prmsg03 ;print thinking message
1920 jsr fill2 ;fill $5000-$53ff printer buffer
1930 lda #$00
1940 sta usr03 ;set the low byte $00
1950 lda #$50
1960 sta usr04 ;high byte $50 <$5000 graphic buffer>
1970 ldx #$00
1980 br05 lda indlo01
1990 sta usr01 ;set the low byte $00
2000 lda indhi01
2010 sta usr02 ;high byte $20 <$2000 ram file storage>
2020 jsr process1 ;
2030 lda #8
2040 clc
2050 adc usr03 ;add 8 to buffer indirection <lo>
2060 sta usr03 ;store the new value
2070 bcc br06 ;test to see if inc. <hi>
2080 inc usr04 ;inc. <hi>
2090 br06 lda #4
2100 clc
2110 adc indhi01 ;inc. hi byte by 4 pages $2000
2120 sta indhi01 ;store the new value
2130 inx ;incrament the loop counter
2140 cpx #10 ;test the loop counter
2150 bne br05
2160 lda indlo01 ;subtract 168
2170 sec ;set the carry
2180 sbc #168
2190 sta indlo01 ;store the new value
2200 bcs br07
2210 dec indhi01 ;dec. the hi byte
2220 br07 lda indhi01
2230 sec ;set the carry
2240 sbc #39 ;subtract 39 <hi byte>
2250 sta indhi01 ;stroe the new value
2260 lda flag01 ;flag=0 skip and $f0 routine
2270 beq br09 ;branch around and routine if normal
2280 lda usr01
2290 pha ;save $fb on stack
2300 lda usr02
2310 pha ;save $fc on stack
2320 ldy #$00
2330 tya
2340 sta usr01 ;set low byte to $00
2350 lda #$50
2360 sta usr02 ;set high byte to $50 <$5000>
2370 ldx #$04 ;set loop counter
2380 br08 lda (usr01),y
2390 and #%11110000
2400 sta (usr01),y ;and off low nibble
2410 iny
2420 bne br08 ;loop
2430 inc usr02 ;incrament high byte of indirection
2440 dex ;decrament loop counter
2450 bne br08 ;test loop counter/loop until done
2460 pla
2470 sta usr02 ;restore $fc
2480 pla
2490 sta usr01 ;restore $fb
2500 lda #$00
2510 sta flag01 ;reset the flag to 0 normal print
2520 br09 jsr prmsg02 ;waiting for printer message
2530 ldx #$50 ;high byte
2540 ldy #$00 ;low byte
2550 jsr prgraph ;print the graphic buffer index x,y
2560 rts ;return to mainline
2570 ;
2580 ;---------------------------------
2590 ;
2600 loadem = * ;
2610 jsr fill1 ;fill graphic area $2000-$47ff with 0's
2620 lda #$00
2630 sta graphics ;reset the # of graphics loaded
2640 sta tape1 ;set load address low byte
2650 lda #$20
2660 sta tape1+1 ;set hi byte load address
2670 loop01 jsr search ;search for next name
2680 bne br10
2690 lda graphics ;a-reg = # loaded
2700 rts
2710 ;
2720 br10 jsr fileload ;load the graphic
2730 bcs loop01
2740 ldx #$00 ;zero the index
2750 ldy #$00 ;zero length
2760 loop02 lda namebuff,x ;load the current name
2770 cmp #$22 ;scan for a qutoe mark
2780 beq br11 ;branch if quote found
2790 sta (fretop),y ;xfer name into name string
2800 iny ;inc length
2810 inx ;inc index
2820 jmp loop02 ;loop around
2830 ;
2840 br11 inc graphics ;inc. # of files loaded
2850 lda graphics ;load # of files loaded
2860 tax ;x-reg # of files loaded
2870 lda index,x ;index byte to position name's
2880 sta fretop
2890 lda #10 ;setup test for 10 files
2900 cmp graphics ;test